//
//  PSEvaluator.h
//  PrefCore
//
//  Created by Sergey on 5/30/14.
//  Copyright (c) 2014 Play-on-smart. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PSCard.h"
#import "PSHand.h"
#import "PSPlayer.h"
#import "PSTrick.h"
#import "PSNodeScore.h"

typedef enum {
    kEvaluatorMisere
,   kEvaluatorPassing
,   kEvaluatorTricking
} PSEvaluatorType;

@interface PSEvaluator : NSObject

+(PSEvaluator*)evaluatorForType:(PSEvaluatorType)type;

-(PSCardHash)startWithCandidates:(PSHandHash)candidates;

-(PSCardHash)nextWithCandidates:(PSHandHash)candidates andCurrent:(PSCardHash)current;

-(PSHandHash)moveCandidatesWithHands:(PSHandHash*)hands
                              player:(PSPlayerId)player
                               trick:(PSTrickHash)trick
                               trump:(PSCardSuit)trump
                               round:(uint32_t)round
                           handIndex:(uint8_t)handIndex
                            declarer:(PSPlayerId)declarer;

-(PSHandHash)moveCandidatesWithHands:(PSHandHash*)hands
                              player:(PSPlayerId)player
                               trick:(PSTrickHash)trick
                               trump:(PSCardSuit)trump
                               round:(uint32_t)round
                           handIndex:(uint8_t)handIndex
                            declarer:(PSPlayerId)declarer
                                drop:(PSHandHash)drop
                                open:(BOOL)open;

-(BOOL)isBetterChild:(PSPackedScore)childScore
              parent:(PSPackedScore)parentScore
              player:(PSPlayerId)player
            declarer:(PSPlayerId)declarer;

-(PSHandHash)filterCandidates:(PSHandHash)candidates
                        hands:(PSHandHash*)hands
                       player:(PSPlayerId)player
                        trick:(PSTrickHash)trick
                        trump:(PSCardSuit)trump
                        round:(uint32_t)round
                    handIndex:(uint8_t)handIndex
                     declarer:(PSPlayerId)declarer
                         open:(BOOL)open;

@end
